package com.junsi.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.junsi.bean.Approve;
import com.junsi.util.PageUtil;

/**
 * 
 * 审批表
 *
 */
@Service
@Transactional(rollbackFor = Exception.class)
public interface ApproveService extends GenericService<Approve> {
	// 批量插入
	public boolean batchSave(List<Approve> approve);

	// 分页查询
	public List<Approve> pageFind(String senderID, PageUtil pageUtil);

	// 查询行数
	public int findCount(String senderid);

	// 分页查询以批准
	public List<Approve> findByAllAlready(String senderID, PageUtil pageUtil);

	// 分页查询審批中
	public List<Approve> findApproveAmong(String senderID, PageUtil pageUtil);

	// 审批人审批
	public List<Approve> tApprove(String approverID, PageUtil pageUtil);

	public Approve FindAcontractApprover(String approver, String acontractId);

	// 更新審批意見
	public boolean updateRemarks(Approve approve);

	// 查询审批人
	public List<Approve> findapprover(String acontractApprove);

	// 批量更新
	public boolean batchUpdate(Approve approve);

	// 查询
	public List<Approve> findByAllAlreadyAll(String senderName);

	// 查询已批准,不批准
	public List<Approve> alreadyapproveAll(String senderName);

	// 查询审批跟踪
	public List<Approve> findapproveRoleId(String id, String staffId);

	// 插入审核
	public boolean batchSaveAudits(List<Approve> approve);

	// 分页查询所有以批准，审批失败
	public int approveCount(String senderid);

	// 分页查询所有已批准
	public int tApproveCount(String approverID);

	// 分页查询所有未批准:审核表
	public List<Approve> findByAllAudits(String senderID, PageUtil pageUtil);

	// 分页查询:审核表
	public int findCountAudits(String senderid);

	// 分页查询所有已批准,不审批
	public List<Approve> findByAllAuditsOne(String senderID, PageUtil pageUtil);

	// 分页查询所有已批准,不审批
	public int findCountAuditsOne(String senderid);

	// 分页查询所有已批准,不审批
	public List<Approve> tApproveAuditsOne(String approverID, PageUtil pageUtil);

	// 分页查询所有已批准,不审批
	public int tApproveCountAudits(String approverID);

	// 查询审批合同：未审批
	public List<Approve> findByAllContractApprove(String senderName, PageUtil pageUtil);

	// 查看以审批完:开户审批
	public int CountAllApprove();

	// 查看以审批完:开户审批分頁
	public List<Approve> findAllAudits(PageUtil pageUtil);

	// 查看以审批完: 合同审核
	public int findCountAllApproveCondition();

	// 查看以审批完:合同审核

	// 时间+ 查询行数开户审批未批准---------
	public int timefindCount(String senderid, String condition);

	// 时间+ 查询分页开户审批未批准
	public List<Approve> timefindByAllContractApprove(PageUtil pageUtil, String senderID, String condition);

	// 时间+ 查询行数开户审批已批准,不审批
	public int timeapproveCount(String senderid, String condition);

	// 时间+ 查询分页开户已批准,不审批
	public List<Approve> timefindByAllAlready(String senderID, PageUtil pageUtil, String condition);

	// 时间+ 分页查询所有已批准
	public int timeTApproveCount(String approverID, String condition);

	// 时间+ 审批人审批
	public List<Approve> timeTApprove(String approverID, PageUtil pageUtil, String condition);

	// 时间+ 分页查询:审核表
	public int timeFindCountAudits(String approverID, String condition);

	// 时间+ 分页查询所有未批准:审核表
	public List<Approve> timeFindByAllAudits(String senderID, PageUtil pageUtil, String condition);

	// 时间+分页查询所有已批准,不审批
	public int timeFindCountAuditsOne(String approverID, String condition);

	// 时间+分页查询所有已批准,不审批
	public List<Approve> timeFindByAllAuditsOne(String senderID, PageUtil pageUtil, String condition);

	// 时间+領導審核:审核表
	public int timeTApproveCountAudits(String approverID, String condition);

	// 时间+領導審核:审核表
	public List<Approve> timeTApproveAuditsOne(String approverID, PageUtil pageUtil, String condition);

	// 时间+后台審核:开户审核
	public int timeCountAllApprove(String condition);

	// 时间+領導審核:开户审核
	public List<Approve> timefindAllAudits(PageUtil pageUtil, String condition);

	// 时间+后台審核:合同
	public int timefindCountAllApproveCondition(String condition);

	// 时间+領導審核:合同
	public List<Approve> timefindAllApproveCondition(PageUtil pageUtil, String condition);

	List<Approve> findAllApproveCondition(PageUtil pageUtil);

	public Integer findAppoveContractSun(String id);

	public Integer findAppoveAuditsSun(String id);
}
